package com;

import com.zgh.mapper.StudentMapper;
import com.zgh.model.Student;
import com.zgh.mybatis.MybatisUtil;
import org.apache.ibatis.session.SqlSession;
import org.junit.Test;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by Administrator on 2017/1/16.
 */
public class tests {
    @Test
    public void stu(){
        SqlSession s = MybatisUtil.getSqlSession();
        StudentMapper st = s.getMapper(StudentMapper.class);
        //List<Student> li = st.saves(null);

       Map<String, java.lang.Object> mm = new HashMap<String, java.lang.Object>();

       mm.put("name","%王%");

        List<Student> li = st.saves(mm);
        for(Student sts : li){
            System.out.println(sts.getName());
        }
        s.commit();
        s.close();
    }

}
